import request from 'UTIL/request'
import { BASE_URL_FN } from '@/config.js'

/**
 * 重置密码前的校验
 */
export function CloudFindPwd(params) {
  return request({
    url: 'cloud/findpwd',
    requiredAuth: false,
    method: 'POST',
    data: params,
		requestType: 'form'
  })
}

/**
 * 注册
 * @param {Object} params
 */
export function CloudRegister(params) {
  return request({
    url: 'cloud/register',
    requiredAuth: false,
    method: 'POST',
    data: params
  })
}

/**
 * 重置密码
 * @param {Object} params
 */
export function CloudResetPwd(params) {
  return request({
    url: 'cloud/resetpwd',
    requiredAuth: false,
    method: 'POST',
    data: params,
		requestType: 'form'
  })
}

/**
 * 发送验证码
 * @param {Object} params
 */
export function CloudSendSms(params) {
  return request({
    url: 'cloud/sendSms',
    requiredAuth: false,
    method: 'POST',
    data: params,
		requestType: 'form'
  })
}

/**
 * 校验验证码
 * @param {Object} params
 */
export function CloudVerifySms(params) {
  return request({
    url: 'cloud/verifySms',
    requiredAuth: false,
    method: 'POST',
    data: params,
		requestType: 'form'
  })
}

/**
 * 校验验证码
 * @param {Object} params
 */
export function VerifyAppid(params) {
	let base = BASE_URL_FN(true)
	base = base.replace('api-11/', '')
	base = base.replace('api/', '')
	
  return request({
    url: base + 'apiuser/user/verifyCompanyUrl',
    requiredAuth: false,
    method: 'POST',
    data: params,
		requestType: 'form'
  })
}